<template>
  <div class="orders">
    <div class="box">
      <h1>接口有问题报错：pagenum 参数错误</h1>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="user_id" label="Date" width="180" />
        <el-table-column prop="pay_status" label="Name" width="180" />
        <el-table-column prop="is_send" label="Address" />
        <el-table-column prop="order_fapiao_title" label="Address" />
        <el-table-column prop="order_fapiao_company" label="Address" />
        <el-table-column prop="order_fapiao_content" label="Address" />
        <el-table-column prop="consignee_addr" label="Address" />
      </el-table>
    </div>
    <div class="boxB">
      <h1>图片上传</h1>
      <el-upload
        v-model:file-list="fileList"
        class="upload-demo"
        action="http://127.0.0.1:8888tmp_uploads"
        :on-preview="handlePreview"
        :on-remove="handleRemove"
        list-type="picture"
      >
        <el-button type="primary" size="default">上传图片</el-button>
        <template #tip>
          <div class="el-upload__tip">jpg/png files with a size less than 500kb</div>
        </template>
      </el-upload>
    </div>
  </div>
</template>

<script lang="ts" setup>
// import { uploading } from '@/api/uploading'
import type { UploadProps, UploadUserFile } from 'element-plus'

// import { getOrdersTable } from '@/api/ordersTbale'
const tableData = ref()

// const fn = async () => {
//   try {
//     await getOrdersTable()
//   } catch (err) {
//     console.log(err)
//   }
//   try {
//     const res = await uploading({
//       file: 'tmp_uploads/ccfc5179a914e94506bcbb7377e8985f.png',
//     })
//     console.log('上传', res)
//   } catch (err) {
//     console.log(err)
//   }
// }
const fileList = ref<UploadUserFile[]>([
  {
    name: 'food.jpeg',
    url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
  },
  {
    name: 'food2.jpeg',
    url: 'https://fuss10.elemecdn.com/3/63/4e7f3a15429bfda99bce42a18cdd1jpeg.jpeg?imageMogr2/thumbnail/360x360/format/webp/quality/100',
  },
])

const handleRemove: UploadProps['onRemove'] = (uploadFile, uploadFiles) => {
  console.log(uploadFile, uploadFiles)
}

const handlePreview: UploadProps['onPreview'] = (file) => {
  console.log(file)
}
</script>

<style scoped lang="scss"></style>
